package com.example.dtos;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Email;

import com.example.models.Cart;
import com.example.models.Customer;
import com.fasterxml.jackson.annotation.JsonIgnore;

public class CustomerDTO {
	
//	private Long id; //THIS IS WHIT MySQL
	@NotNull(message="Id cannot be null")
	private String id;
	@NotNull(message="Username cannot be null")
	@Size(min = 6, max = 20, message="Username must have between 6 and 20 characters")
	private String username;
	@NotNull(message="First name cannot be null")
	@Size(min = 2, max = 14, message="First name must have between 2 and 14 characters")
	private String firstName;
	@NotNull(message="Last name cannot be null")
	@Size(min = 2, max = 20, message="Last name must have between 2 and 20 characters")
	private String lastName;
//	@Email
//	private String mail;
//	@Valid
//	private Set<Cart> savedCarts= new HashSet<Cart>();
	
	public CustomerDTO(){}
	
//	public CustomerDTO(String id, String username, String firstName, String lastName, Set<Cart> savedCarts) {
//	public CustomerDTO(Long id, String username, String firstName, String lastName, Set<Cart> savedCarts) {
//		super();
//		this.id = id;
//		this.username = username;
//		this.firstName = firstName;
//		this.lastName = lastName;
//		this.savedCarts = savedCarts;
//	}
	
	public CustomerDTO(String id, String username, String firstName, String lastName) {
//		public CustomerDTO(Long id, String username, String firstName, String lastName, Set<Cart> savedCarts) {
			super();
			this.id = id;
			this.username = username;
			this.firstName = firstName;
			this.lastName = lastName;
		}
	
	
//	public Long getId() {
//		return id;
//	}
//
//	public void setId(Long id) {
//		this.id = id;
//	}

		public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
//	public Set<Cart> getSavedCarts() {
//		return savedCarts;
//	}
//	public void setSavedCarts(Set<Cart> savedCarts) {
//		this.savedCarts = savedCarts;
//	}
}
